package com.lwb.ztx.main.presenter;

import com.lwb.ztx.bean.ProfileBean;
import com.lwb.ztx.main.model.LoadingModel;
import com.lwb.ztx.main.model.LoadingModelImpl;
import com.lwb.ztx.main.view.LoadingView;
import com.lwb.ztx.main.view.MainView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/5/28.
 */
public class MainPresenterImpl implements MainPresenter ,LoadingModelImpl.OnLoadingFinishListener{
    private MainView mainView;
    private LoadingModel loadingModel;
    public MainPresenterImpl(MainView mainView) {
        this.mainView = mainView;
        loadingModel = new LoadingModelImpl(this);
    }

    @Override
    public void getTotalProfile() {
        loadingModel.loadTotalProfile();
    }

    @Override
    public void onSuccess(List<ProfileBean> profileBeanList) {
        mainView.onLoadingFinish(profileBeanList);
    }

    @Override
    public void onFailure() {
        mainView.onLoadingFinish(new ArrayList<ProfileBean>());
    }
}
